const express        = require('express');
const app            = express();
const port = 8000;
const chatApp = require('./routers/chat/chat2.js');

var session = require('express-session')

const parseXlsx = require('./routers/util/parseXlsx.js');
const util = require('./routers/util/XP2.js');
const gb = require('./routers/gb/gb.js');
const tranCenter = require('./routers/t/t.js');
// const dbCon = require('./db/test.js');
const dbRouter = require('./test/db/main.js');
const miscRouter = require('./routers/misc/misc.js');
const testRouter = require('./routers/misc/test.js')


app.use(session({
    secret: 'work hard',
    resave: true,
    saveUninitialized: false,
    cookie: { maxAge: 60000 }
}));
app.use((req, res, next)=>{
    res.set('set-cookie', 'asshole=true; path=/');
    next();
})

app.use('/parseXlsx', parseXlsx);
app.use('/util', util);
app.use('/gb', gb);
app.use('/', express.static('static'))
app.use('/trancenter', tranCenter);
app.use('/db', dbRouter);
app.use('/misc', miscRouter);
app.use('/test', testRouter);

app.listen(port, ()=>{console.log(`${port}: ok!`)})